#include<func.h>
int main(int argc,char*argv[])
{
    //./ homework03 file1 file2
    ARGS_CHECK(argc,3);
    int fd = open(argv[1],O_RDONLY);
    int fd2 = open(argv[2],O_RDONLY);

    ERROR_CHECK(fd,-1,"open");
    ERROR_CHECK(fd2,-1,"open");


    char buf[1024]={0};
    char buf2[1024]={0};
    //读取判断
    while(1)
    {
        memset(buf,0,sizeof(buf));
        memset(buf2,0,sizeof(buf2));

        ssize_t sret = read(fd,buf,sizeof(buf));
        ssize_t sret = read(fd2,buf2,sizeof(buf2));

        ERROR_CHECK(fd,-1,"open");
        ERROR_CHECK(fd2,-1,"open");

        if(strcmp(buf,buf2)!=0)
        {
            printf("完全不一样");
            exit(1);
        }
        if(sret ==0)
        {
            break;
        }
    }
    printf("内容完全一致");
    close(fd);
    clsoe(fd2);
    return 0;
}